<template>
	<view class="page">
		<u-index-list :index-list="indexList" :scrollTop="scrollTop" @select="selectT">
			<template v-for="(item, index1) in itemArr">
				<!-- #ifdef APP-NVUE -->
				<u-index-anchor :text="index1"></u-index-anchor>
				<!-- #endif -->
				<u-index-item>
					<!-- #ifndef APP-NVUE -->
					<u-index-anchor :text="index1"></u-index-anchor>
					<!-- #endif -->
					<view class="list-cell" v-for="(cell, index) in item">
						<view class="contnet" @click="select_type(itemArr[index1][index].id)">
							<view class="contnet_icon" style="margin: 0 30rpx 0 26rpx;">
								<img :src="cell.logo" alt="" style="width: 100%;height: 100%;">
							</view>
							<view class="contnet_title">
								{{cell.name}}
							</view>
						</view>
					</view>
				</u-index-item>
			</template>
		</u-index-list>

	</view>
</template>

<script>
	export default {

		data() {
			return {
				scrollTop: 0,
				indexList: ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S",
					"T", "U", "V", "W", "X", "Y", "Z"
				],
				itemArr: [
					
				]
			}
		},
		onLoad() {
			this.getList();
		},
		onPageScroll(e) {
			this.scrollTop = e.scrollTop
		},
		methods: {
			async getList() {
				
				//获取练习列表数据
				const res = await this.$post(`/biz/wxInstallment/getAllBrand`,{
					
				})
				this.itemArr=res.data.data.result
				//this.indexList=res.data.data.words				
			},
			// 去选择车型
			// val就是某个品牌数据
			select_type(val) {
				// console.log(val,'val');
				// let pages = getCurrentPages()
				// let prevPage = pages[pages.length - 2]
				// prevPage.$vm.form.carPrice = val.minPrice
				uni.navigateTo({
					url:`./select_cartype?pingpaiID=${val}`
				})
			}
		}
	}
</script>

<style>
	.page {
		overflow-y: auto;
		width: 100%;
		height: 100vh;
		background-color: #fff;
		padding-bottom: 26rpx;
	}

	.list-cell {
		width: 690rpx;
		display: flex;
		box-sizing: border-box;
		overflow: hidden;
		color: #323233;
		font-size: 14px;
		line-height: 24px;
		background-color: #fff;
		border-bottom: 2rpx solid #F4F4FA;
		border-top: 2rpx solid #F4F4FA;
		height: 131rpx;
		margin: 0 auto 0;
	}

	.contnet {
		display: flex;
		justify-content: flex-start;
		align-items: center;
		width: 100%;
		height: 100%;
		/* background-color: red; */
	}

	.contnet_icon {
		width: 67rpx;
		height: 61rpx;
	}

	.contnet_title {
		font-size: 26rpx;
		font-family: 'PingFang SC-Regular, PingFang SC';
		font-weight: 400;
		color: #1A1824;
	}

	.u-index-anchor {
		background-color: #fff !important;
		width: 670rpx !important;
		height: 80rpx !important;
		margin: 0 auto 0 !important;
	}
</style>
